package com.comiee.airwalker.common

import com.comiee.airwalker.AirWalkerMod.logger
import com.comiee.airwalker.block.BlockLoader
import com.comiee.airwalker.enchantment.EnchantmentLoader
import net.minecraftforge.fml.common.event._

/**
 * 服务器端
 */
class CommonProxy {

  def preInit(event: FMLPreInitializationEvent): Unit = {
    logger = event.getModLog //获取logger

    BlockLoader(event) //注册方块
  }

  def init(event: FMLInitializationEvent): Unit = {
    EnchantmentLoader(event) //注册附魔
  }

  def postInit(event: FMLPostInitializationEvent): Unit = {
    logger.info("finish!!")
  }

  def serverStarting(event: FMLServerStartingEvent): Unit = {
  }

  def serverStopping(event: FMLServerStoppingEvent): Unit = {
    EnchantmentLoader.destroy()
  }
}
